package ns2;

import util.SSIDException;

public enum Event_Type {

	/**
	 * Event type given by symbol r
	 */
	Receive,

	/**
	 * Event type given by symbol +
	 */
	Enqueued,

	/**
	 * Event type given by symbol -
	 */
	Dequeued,

	/**
	 * Event type given by symbol d
	 */
	Dropped;

	public static Event_Type check(String event) throws SSIDException {
		if (event.equals("r"))
			return Event_Type.Receive;
		else if (event.equals("+"))
			return Event_Type.Enqueued;
		else if (event.equals("-"))
			return Event_Type.Dequeued;
		else if (event.equals("d"))
			return Event_Type.Dropped;
		else
			throw new SSIDException("Error: unknown event type in trace file.");
	}

}
